package cn.daneijiaoyuarrys;

import java.util.Arrays;

/**
 * @author SWJ
 * @create 2021-06-05 11:25
 */
/**创建一个无序数组*/
public class BubbleSort {
    public static void main(String[] args) {
    int[]from={1,3,4,7,6,7,7};
    //数组普通复制
    //第一个参数：普通复制
        int[]to= Arrays.copyOf(from,5);
        System.out.println(Arrays.toString(to));
    //对数组进行扩容
        int[] to2=Arrays.copyOf(from,10);
        //from是数组
        System.out.println(Arrays.toString(to2));
        //数组的缩容
        int[]to3=Arrays.copyOf(from,3);
        System.out.println(Arrays.toString(to3));
        //截取首尾元素控制数组个数
        //这个方法指定是数组的下标 左闭右开 含头不含尾
        int[]to4=Arrays.copyOfRange(from,0,4);
        //从2开始到4结束
        System.out.println(Arrays.toString(to4));
    }
}
//
//"C:\Program Files\Java\jdk1.8.0_91\bin\java.exe" "-javaagent:D:\Program Files\JetBrains\IntelliJ IDEA 2020.2.3\lib\idea_rt.jar=58316:D:\Program Files\JetBrains\IntelliJ IDEA 2020.2.3\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_91\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\rt.jar;E:\idea\Java Module\out\production\Java Module" cn.tedu.BubbleSort
//        [1, 3, 4, 7, 6]
//        [1, 3, 4, 7, 6, 7, 7, 0, 0, 0]
//        [1, 3, 4]
//        [1, 3, 4, 7]
//
//        Process finished with exit code 0
